/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ourgame.tankgame.blood;

import com.ourgame.tankgame.exception.BloodVolumeWarring;

/**
 *
 * @author L
 */
public class BloodVolume {

    private int bloodValue = -1;

    public BloodVolume(int boodValue) {
        this.bloodValue = boodValue;
    }

    /**
     * 加血
     * @param value 
     */
    public void increase(int value) {
        if (value > 0) {
            bloodValue += value;
        } else {
            System.out.println(value);
            throw new BloodVolumeWarring();
        }
    }

    /**
     * 扣血
     * @param value 
     */
    public void decrease(int value) {
        if (value > 0) {
            bloodValue -= value;
        }
    }
}
